<?php
namespace application\cms\controller\admin;

use library\page;

class Nav{

    //导航首页
    function index(){   
        $tablename = 'rj_cms_nav';
        //查询导航列表
        $nav_sql="select * from ".tablename($tablename)." ";

        $page=new page\Deep_Page($GLOBALS['db'],2);

        $nav_sql=$page->getPageSQL($nav_sql);

        $rs=$GLOBALS['db']->query($nav_sql);
        
        require view('admin/nav/nav.php');
    } 

    //添加-修改导航页面
    function nav_edit(){
        //判断添加-修改
        if(isset($_GET['id']) && $_GET['id']!='' ){
            $id = $_GET['id'];
            $nav_sql="select * from ".tablename($tablename)." where id=".$id." ";
            $ret=$GLOBALS['db']->query($nav_sql);
        }

        require view('admin/nav/nav_edit.php');
    }



}
